package model

import "database/sql"

type GetPhysicalListRes struct {
	RetCode int64          `json:"retCode"`
	Total   int64          `json:"total"`
	Data    []PhysicalList `json:"data"`
}

type PhysicalList struct {
	Id                              int64       `json:"id"`
	SchoolRollId                    string      `json:"schoolRollId"`
	Name                            string      `json:"name"`
	Sex                             string      `json:"sex"`
	Grade                           string      `json:"grade"`
	Class                           string      `json:"class"`
	School                          string      `json:"school"`
	MeasureDate                     string      `json:"measureDate"`
	IsExemption                     string      `json:"isExemption"`
	MissingTestNum                  byte        `json:"missingTestNum"`
	PhysicalTotalScore              float64     `json:"physicalTotalScore"`
	PhysicalBasicScore              float64     `json:"physicalBasicScore"`
	PhysicalExtraScore              float64     `json:"physicalExtraScore"`
	PhysicalLevel                   string      `json:"physicalLevel"`
	Height                          interface{} `json:"height"`
	Weight                          interface{} `json:"weight"`
	BodyMassIndex                   interface{} `json:"bodyMassIndex"`
	BodyMassIndexBasicScore         interface{} `json:"bodyMassIndexBasicScore"`
	BodyMassIndexExtraScore         interface{} `json:"bodyMassIndexExtraScore"`
	BodyMassIndexTotalScore         interface{} `json:"bodyMassIndexTotalScore"`
	BodyMassIndexLevel              string      `json:"bodyMassIndexLevel"`
	VitalCapacity                   interface{} `json:"vitalCapacity"`
	VitalCapacityBasicScore         interface{} `json:"vitalCapacityBasicScore"`
	VitalCapacityExtraScore         interface{} `json:"vitalCapacityExtraScore"`
	VitalCapacityTotalScore         interface{} `json:"vitalCapacityTotalScore"`
	VitalCapacityLevel              string      `json:"vitalCapacityLevel"`
	FiftyMeters                     interface{} `json:"fiftyMeters"`
	FiftyMetersBasicScore           interface{} `json:"fiftyMetersBasicScore"`
	FiftyMetersExtraScore           interface{} `json:"fiftyMetersExtraScore"`
	FiftyMetersTotalScore           interface{} `json:"fiftyMetersTotalScore"`
	FiftyMetersLevel                string      `json:"fiftyMetersLevel"`
	SitAndReach                     interface{} `json:"sitAndReach"`
	SitAndReachBasicScore           interface{} `json:"sitAndReachBasicScore"`
	SitAndReachExtraScore           interface{} `json:"sitAndReachExtraScore"`
	SitAndReachTotalScore           interface{} `json:"sitAndReachTotalScore"`
	SitAndReachLevel                string      `json:"sitAndReachLevel"`
	OneMinuteRopeSkipping           interface{} `json:"oneMinuteRopeSkipping"`
	OneMinuteRopeSkippingBasicScore interface{} `json:"oneMinuteRopeSkippingBasicScore"`
	OneMinuteRopeSkippingExtraScore interface{} `json:"oneMinuteRopeSkippingExtraScore"`
	OneMinuteRopeSkippingTotalScore interface{} `json:"oneMinuteRopeSkippingTotalScore"`
	OneMinuteRopeSkippingLevel      string      `json:"oneMinuteRopeSkippingLevel"`
	OneMinuteSitUps                 interface{} `json:"oneMinuteSitUps"`
	OneMinuteSitUpsBasicScore       interface{} `json:"oneMinuteSitUpsBasicScore"`
	OneMinuteSitUpsExtraScore       interface{} `json:"oneMinuteSitUpsExtraScore"`
	OneMinuteSitUpsTotalScore       interface{} `json:"oneMinuteSitUpsTotalScore"`
	OneMinuteSitUpsLevel            string      `json:"oneMinuteSitUpsLevel"`
	ShuttleRun                      interface{} `json:"shuttleRun"`
	ShuttleRunBasicScore            interface{} `json:"shuttleRunBasicScore"`
	ShuttleRunExtraScore            interface{} `json:"shuttleRunExtraScore"`
	ShuttleRunTotalScore            interface{} `json:"shuttleRunTotalScore"`
	ShuttleRunLevel                 string      `json:"shuttleRunLevel"`
	StandingLongJump                interface{} `json:"standingLongJump"`
	StandingLongJumpBasicScore      interface{} `json:"standingLongJumpBasicScore"`
	StandingLongJumpExtraScore      interface{} `json:"standingLongJumpExtraScore"`
	StandingLongJumpTotalScore      interface{} `json:"standingLongJumpTotalScore"`
	StandingLongJumpLevel           string      `json:"standingLongJumpLevel"`
	Chinning                        interface{} `json:"chinning"`
	ChinningBasicScore              interface{} `json:"chinningBasicScore"`
	ChinningExtraScore              interface{} `json:"chinningExtraScore"`
	ChinningTotalScore              interface{} `json:"chinningTotalScore"`
	ChinningLevel                   string      `json:"chinningLevel"`
	OneThousandMeters               interface{} `json:"oneThousandMeters"`
	OneThousandMetersBasicScore     interface{} `json:"oneThousandMetersBasicScore"`
	OneThousandMetersExtraScore     interface{} `json:"oneThousandMetersExtraScore"`
	OneThousandMetersTotalScore     interface{} `json:"oneThousandMetersTotalScore"`
	OneThousandMetersLevel          string      `json:"oneThousandMetersLevel"`
	EightHundredMeters              interface{} `json:"eightHundredMeters"`
	EightHundredMetersBasicScore    interface{} `json:"eightHundredMetersBasicScore"`
	EightHundredMetersExtraScore    interface{} `json:"eightHundredMetersExtraScore"`
	EightHundredMetersTotalScore    interface{} `json:"eightHundredMetersTotalScore"`
	EightHundredMetersLevel         string      `json:"eightHundredMetersLevel"`
	BodyFat                         interface{} `json:"bodyFat"`
	BodyFatLevel                    string      `json:"bodyFatLevel"`
	Grip                            interface{} `json:"grip"`
	GripLevel                       string      `json:"gripLevel"`
	ResponseCapability              interface{} `json:"responseCapability"`
	ResponseCapabilityLevel         string      `json:"responseCapabilityLevel"`
	BalanceAbility                  interface{} `json:"balanceAbility"`
	BalanceAbilityLevel             string      `json:"balanceAbilityLevel"`
	VerticalJump                    interface{} `json:"verticalJump"`
	VerticalJumpLevel               string      `json:"verticalJumpLevel"`
}

func (PhysicalList) AppendItem(result *interface{}, basic *interface{}, extra *interface{}, total *interface{}, level *string, scoreResult *sql.NullFloat64, scoreBasic *sql.NullFloat64, scoreExtra *sql.NullFloat64, scoreTotal *sql.NullFloat64, scoreLevel *sql.NullString) {
	*level = scoreLevel.String
	if scoreLevel.Valid {
		if scoreResult.Valid {
			*result = scoreResult.Float64
		} else {
			*result = ""
		}
		*basic = scoreBasic.Float64
		*extra = scoreExtra.Float64
		*total = scoreTotal.Float64
	} else {
		*result = ""
		*basic = ""
		*extra = ""
		*total = ""
	}
}

func (PhysicalList) AppendExtra(result *interface{}, level *string, scoreResult *sql.NullFloat64, scoreLevel *sql.NullString) {
	*level = scoreLevel.String
	if scoreLevel.Valid {
		if scoreResult.Valid {
			*result = scoreResult.Float64
		} else {
			*result = ""
		}
	} else {
		*result = ""
	}
}
